package simulator;

import java.util.HashMap;

/**
 * This class stores facts about each GameObject. No State-dependent data is stored here.
 * This information is stored permanently in the JSON file, and parsed into these objects by GameDataStore
 * This is basically just a Java representation of the data stored in each JSON Object in the file
 */

public class GameObject {
	protected GameAsset asset;
	
	protected String name;
	protected int mineralCost;
	protected int vespeneCost;
	protected int buildTime;
	protected int supply;
	protected int buildSlots;
	protected boolean occupyWorkers;
	
	protected HashMap<GameAsset, Integer> dependencies;
	protected HashMap<GameAsset, Integer> blockingDependencies;

	public GameObject(GameAsset asset) {
		this.asset = asset;
	}

	public int getMineralCost() {
		return mineralCost;
	}
	
	public int getVespeneCost() {
		return vespeneCost;
	}
	public int getSupply() {
		return supply;
	}
	public int getBuildTime() {
		return buildTime;
	}
	public GameAsset getGameAsset() {
		return asset;
	}
	public String getName() {
		return name;
	}

	public int getFinishBuilding(int startBuildingTime) {
		return startBuildingTime + buildTime; 
	}

	public HashMap<GameAsset, Integer> getDependencies() {
		return dependencies;
	}
	
	public HashMap<GameAsset, Integer> getBlockingDependencies() {
		return blockingDependencies;
	}
}
